#include "stdafx.h"
#include "CodeTool.h"
#include "Diabetes.h"
#include "FormLogin.h"
#include "FormMain.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BEGIN_MESSAGE_MAP(CDiabetesApp, CWinApp)
	//{{AFX_MSG_MAP(CDiabetesApp)
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

CDiabetesApp::CDiabetesApp()
{
}

CDiabetesApp theApp;

BOOL CDiabetesApp::InitInstance()
{
	if(CCodeTool::Xqm_IsExistInstance("XqmDiabetes"))
		return FALSE;
	if(0==InitSkinMagicLib(AfxGetInstanceHandle(),NULL,NULL,NULL))
		return FALSE;
	if(0==LoadSkinFile("skin.smf"))
		return FALSE;

	AfxEnableControlContainer();

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	CFormLogin dlg;
	m_pMainWnd = &dlg;
	if(dlg.DoModal()==IDOK)
	{	
	}
	else
	{
	}
	return FALSE;
}

int CDiabetesApp::ExitInstance() 
{
	::ExitSkinMagicLib();
	return CWinApp::ExitInstance();
}
